FROM docker.m.daocloud.io/centos:7.6.1810

ADD start.sh /start.sh
ADD webvirtmgr-4.8.9.tar.gz /

WORKDIR /webvirtmgr-4.8.9

# yum 相关的依赖
RUN rm -f /etc/yum.repos.d/*.repo && \
    curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && \
    yum install -y epel* && \
    yum install -y python-pip libvirt-python libxml2-python python-websockify gcc python-devel && \
    yum clean all

# python 相关的依赖
RUN pip install numpy==1.16.3 -i https://mirrors.aliyun.com/pypi/simple/ && \
    pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ && \
    echo no | python manage.py syncdb && \
    echo yes | python manage.py collectstatic

RUN yum install -y cyrus-sasl cyrus-sasl-scram cyrus-sasl-devel cyrus-sasl-md5 && \
    yum clean all

CMD ["/usr/bin/bash","/start.sh"]
